local skel = fk.CreateSkill{
  name = "kqf__jinglei",
}
Fk:loadTranslationTable{
  ["kqf__jinglei"] = "惊雷",
  [":kqf__jinglei"] = "每轮开始时，你可以执行五次【浮雷】判定，"..
  "每次判定后，若此结果可使【兵粮寸断】/【八卦阵】/【乐不思蜀】失效，则你获得判定牌/重铸一张牌/回复1点体力。",

  ["#kqf__jinglei"] = "惊雷：你可以执行五次【浮雷】判定，"..
  "每次判定后，若此结果可使【兵粮寸断】/【八卦阵】/【乐不思蜀】失效，则你获得判定牌/重铸一张牌/回复1点体力。",

  ["#kqf__jinglei_ask"] = "惊雷：请重铸一张牌",

  ["$kqf__jinglei1"] = "雷劫锻体，清瘴涤魂。",
  ["$kqf__jinglei2"] = "欲得长生，必受此劫。",
}

skel:addEffect(fk.RoundStart, {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = player
    for i = 1, 5, 1 do
      local judge = {
        who = to,
        reason = skel.name,
      }
      room:judge(judge)
      local c = judge.card
      if c.suit == Card.Spade then
        room:damage{
          to = to,
          damage = 1,
          damageType = fk.ThunderDamage,
          skillName = skel.name,
        }
      end
      if c.suit == Card.Club then
        room:obtainCard(to,c,true,fk.ReasonJustMove,player,skel.name)
      end
      if c.color == Card.Black and not to:isNude() then
        local p,cc = room:askToChooseCardsAndPlayers(to,{
          prompt = "#kqf__jinglei_ask",
          min_card_num = 1,
          max_card_num = 1,
          min_num = 0,
          max_num = 0,
          cancelable = false,
          targets = {},
          skill_name = skel.name,
        })
        room:recastCard(cc,to,skel.name)
      end
      if c.suit == Card.Heart then
        room:recover{
          who = to,
          skillName = skel.name,
          num = 1,
        }
      end
    end
  end
})


return skel